# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fatback
pkgver=1.3
pkgrel=2
pkgdesc="A tool for recovering files from FAT file systems"
url="https://sourceforge.net/projects/fatback/"
arch="all"
license="GPL-2.0"
makedepends="byacc flex-dev"
options="!check" # no tests
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/fatback/fatback-$pkgver.tar.gz
	gcc14.patch
	"

prepare() {
	default_prepare

	# regenerate with flex & byacc
	rm -v setl.c sety.c
}

build() {
	./configure \
		--prefix=/usr \
		--infodir=/usr/share/info \
		--mandir=/usr/share/man
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
be76a40eb981e3d33730811e846fc4fce6c6e4a7833ef37076d14da62e0741490b566bc17a4268f0861e004088493eb3e0d36771f4c7aa9bf7e765e5a0a65d82  fatback-1.3.tar.gz
43f6368ddfc6baf6a7170fb7b399421e636e8a2a650ceec2f09cc002331850603c6753efe61ebeea6a97d77c51d32226fb9e22bd857655c169431e8ce95de2a7  gcc14.patch
"
